/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'
import ModuleLayout from '@/layout/module'

const orderRouter = {
  path: '/order',
  component: Layout,
  redirect: '/order/default',
  name: 'Order',
  meta: {
    title: '订单',
    icon: 'order'
  },
  children: [
    // {
    //   path: '/order/dashboard',
    //   component: ModuleLayout,
    //   name: 'OrderDashboard',
    //   redirect: '/order/dashboard/index',
    //   meta: {
    //     title: '订单管理',
    //     icon: 'em-icon-order'
    //   },
    //   children: [
    //     {
    //       path: '/order/dashboard/index',
    //       component: () => import('@/views/order/dashboard/index'),
    //       name: 'OrderDashboardIndex',
    //       meta: {
    //         title: '订单',
    //         keepAlive: true
    //       },
    //       hidden: true
    //     },
    //     {
    //       path: '/order/dashboard/view/:id',
    //       component: () => import('@/views/order/dashboard/view'),
    //       name: 'order/dashboard/view/:id',
    //       meta: {
    //         title: '详情'
    //       },
    //       hidden: true
    //     }
    //   ]
    // },
    // {
    //   path: '/order/admin',
    //   component: ModuleLayout,
    //   name: 'OrderAdmin',
    //   redirect: '/order/admin/index',
    //   meta: {
    //     title: '订单管理',
    //     icon: 'em-icon-order',
    //     roles: ['admin', 'shop']
    //   },
    //   children: [
    //     {
    //       path: '/order/admin/index',
    //       component: () => import('@/views/order/admin/index'),
    //       name: 'OrderAdminIndex',
    //       meta: {
    //         title: '订单',
    //         keepAlive: true
    //       },
    //       hidden: true
    //     },
    //     {
    //       path: '/order/admin/view/:id',
    //       component: () => import('@/views/order/admin/view'),
    //       name: 'order/admin/view/:id',
    //       meta: {
    //         title: '详情'
    //       },
    //       hidden: true
    //     }
    //   ]
    // },
    // {
    //   path: '/order/default',
    //   component: ModuleLayout,
    //   name: 'OrderDefault',
    //   redirect: '/order/default/index',
    //   meta: {
    //     title: '订单管理',
    //     icon: 'em-icon-order',
    //     roles: ['admin', 'shop', 'store']
    //   },
    //   children: [
    //     {
    //       path: '/order/default/index',
    //       component: () => import('@/views/order/default/index'),
    //       name: 'OrderDefaultIndex',
    //       meta: {
    //         title: '订单'
    //       },
    //       hidden: true
    //     },
    //     {
    //       path: '/order/default/view/:id',
    //       component: () => import('@/views/order/default/view'),
    //       name: 'order/default/view/:id',
    //       meta: {
    //         title: '详情'
    //       },
    //       hidden: true
    //     }
    //   ]
    // },
    {
      path: '/order/default',
      component: ModuleLayout,
      name: 'OrderDefault',
      redirect: '/order/default/index',
      meta: {
        title: '订单管理',
        icon: 'em-icon-order',
        roles: ['admin', 'shop', 'store']
      },
      children: [
        {
          path: '/order/default/index',
          component: () => import('@/views/order/index'),
          name: 'OrderDefaultIndex',
          meta: {
            title: '订单'
          },
          hidden: true
        },
        {
          path: '/order/default/view/:id',
          component: () => import('@/views/order/view'),
          name: 'order/default/view/:id',
          meta: {
            title: '详情'
          },
          hidden: true
        }
      ]
    },
    {
      path: '/order/deliver',
      component: ModuleLayout,
      name: 'OrderDeliver',
      redirect: '/order/deliver/index',
      meta: {
        title: '订单发货',
        icon: 'em-icon-express-truck'
      },
      children: [
        {
          path: '/order/deliver/index',
          component: () => import('@/views/order/deliver/index'),
          name: 'OrderDeliverIndex',
          meta: {
            title: '订单发货'
          },
          hidden: true
        },
        {
          path: '/order/deliver/view/:id',
          component: () => import('@/views/order/deliver/view'),
          name: 'order/deliver/view/:id',
          meta: {
            title: '发货设置'
          },
          hidden: true
        }
      ]
    }
  ]
}
export default orderRouter
